﻿<%@ Page Language="C#" MasterPageFile="~/Theme/Stander/Stander.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Users_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>用户列表</h2>
<asp:GridView ID="GridViewUsers" runat="server" AutoGenerateColumns="False" DataKeyNames="UserName" CssClass="normal mouseOver">
    <Columns>
        <asp:HyperLinkField DataNavigateUrlFields="UserName" DataNavigateUrlFormatString="~/Users/User.aspx?user={0}"
            DataTextField="UserName" HeaderText="姓名" />
         <asp:TemplateField>
            <ItemTemplate>
            <a id="A1" href='<%# Eval("Email", "mailto:{0}") %>'><%# Eval("Email")%></a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="LastActivityDate" DataFormatString="{0:yyyy-M-d hh:mm}" HeaderText="最近活动时间" />
        <asp:CheckBoxField DataField="IsOnline" HeaderText="当前在线" ReadOnly="True">
            <ItemStyle HorizontalAlign="Center" />
        </asp:CheckBoxField>
        <asp:HyperLinkField DataNavigateUrlFields="UserName" DataNavigateUrlFormatString="~/Users/User.aspx?user={0}"
           Text="查看" />
        <asp:TemplateField>
            <ItemTemplate>
            <a href='<%# Eval("UserName", "~/Users/?DeleteUser={0}") %>' visible='<%# User.IsInRole("GeneralManager") %>' onclick='return confirm("确定删除?");' runat="server">删除</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
</asp:Content>